package com.example.demo.Aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

/**
 * @Author : 叶荻风
 * @create : 2024/5/23 11:44
 */
@Aspect
public class MyAspect {
    @Pointcut("execution(* *..UserServiceImpl.*(..))")
    public void myPointCut(){}


    @Around("myPointCut()")
    public Object myAround(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("-------aspect log-------");
        Object proceed = pjp.proceed();
        return proceed;
    }
    @Around("myPointCut()")
    public Object myAround1(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("-------tx log-------");
        Object proceed = pjp.proceed();
        return proceed;
    }
}
